from django.urls import path
# from rest_framework_jwt.views import obtain_jwt_token
from user.views import *
from rest_framework_simplejwt.views import TokenObtainPairView, TokenObtainSlidingView
from rest_framework.routers import DefaultRouter

urlpatterns = [
    # path('login/', obtain_jwt_token),
    path('pairlogin/', TokenObtainPairView.as_view()),  # 返回过期时间token和刷新时间token
    path('login/', MyTokenView.as_view()),  # 映射自定义的Token视图
    path('image/verification/<uuid>/', ImageVerifyView.as_view()),
]
router = DefaultRouter()
router.register('user', UserViewSet)
# 如果没有设置basename将会使用基于views视图集中的queryset属性。如果不使用queryset属性，自定义get_queryset方法，那么必须设置basename参数
router.register('area', AreaViewSet, basename='area')
router.register('address', AddressViewSet, basename='address')
urlpatterns += router.urls
